#include "journaltabwidget.h"
#include <QTabBar>
#include <QLabel>
#include <QString>

JournalTabWidget::JournalTabWidget(QWidget* parent): KTabWidget(parent)
{
    // A very usefull comment indeed.
    setTabsClosable(true);
    setMovable(true);
    setDocumentMode(true);

    // Hide the tab bar per default. Only visible when there are more than 1 tab.
    setTabBarHidden(true);
}

void JournalTabWidget::addTab(QWidget* page, const QString& label)
{
    KTabWidget::addTab(page, label);

    if (count() > 1) {
        setTabBarHidden(false);
    }
}

void JournalTabWidget::addTab(QWidget* page, const QIcon& icon, const QString& label)
{
    KTabWidget::addTab(page, icon, label);
    if (count() > 1) {
        setTabBarHidden(false);
    }
}


